package com.twu.biblioteca.menu;

import com.twu.biblioteca.books.Book;
import com.twu.biblioteca.books.BookCollection;
import com.twu.biblioteca.users.UserSession;

public class DisplayListOfBooksOption implements OptionChoosenByUser {

    @Override
    public void execute() {
        if (UserSession.isUserLoggedIn()) {
            BookCollection bookCollection = BookCollection.getInstance();
            for (Book book : bookCollection.getAll()){
                System.out.println(book);
            }
        } else {
            System.out.println("You are not allowed to view the list of books");
        }
    }
}



